email me at borlaj@portlandschools.org

Loading
notes previous (11/<11) submit the dump links  
 

Array Activities in ArrayPractice

 

In a method public void practiceArrayInts() do the following (just do one after the other):

  1. Create an array size 10 of integers.
  2. Have it have the values 10,20,30,40,50 and so on.
  3. Print out all the numbers in the array.
  4. Find the sum of all the numbers in the array and print that out.//use a loop
  5. Add 7 to every number in the array. //use a loop

In a method public void practiceArrayStrings() do the following: (

  1. Create an array with 3 names.
  2. Have it print out every name on its own line.
  3. Have it print out the length of each name ( ie Jeff -> 4 letters
  4. Have it replace all the a and e with z.
  5. Have it print it out.

 

Start with the coede below:

/**
 * ArrayPractice - basic practice of Arrays
 * 
 * @author (your name) 
 * @version 1-3-13
 */
public class ArrayPractice
{
   public void practiceArrayInts()
   {
       
   }
   
   public void practiceArrayStrings() 
   {
       
   }
}